package com.ten.jinxiancun.controller;

import com.ten.jinxiancun.server.impl.PurchasereturnsDetailsServerImpl;
import com.ten.jinxiancun.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

//采购退货明细表
@RestController
@RequestMapping("/PurTuDe")
public class PurchasereturnsDetailsController {
    @Autowired
    PurchasereturnsDetailsServerImpl purTuD;

    @RequestMapping("/getAllPurtuDe")
    public Object getAllPurtuDe(@RequestParam Map<String, Object> map) {
        Integer limit = Integer.parseInt(map.get("limit").toString());
        Integer page = Integer.parseInt(map.get("page").toString());
        map.put("limit", limit);
        map.put("page", (page - 1) * limit);
        Result res = new Result("0", "true", purTuD.countFind(map), purTuD.getAllPurtuDeFind(map));
        return res;
    }
}
